var vm = new Vue({
  el: '#headerBox',
  data: {
    data:[
        {
            name:"3D模型",
            type:1,
            url:"threeMode",
            path:"/model"
        },
        {
            name:"SU模型",
            type:2,
            url:"skMode",
            path:"/sumodel"
        },
        {
            name:"施工图",
            type:3,
            url:"constr",
            path:"/cad"
        },
        {
            name:"概念方案",
            type:4,
            url:"concept",
            path:"/concept"
        },
        {
            name:"高清案例",
            type:7,
            url:"definition",
            path:"/works"
        },
        {
            name:"材质贴图",
            type:6,
            url:"czMap",
            path:"/material"
        },
    ],
    sortName:"分类",//分类显示的名称
    sortType: 0,//分类的类型
    sortUrl:"",
    serachText : "",//搜索内容
    serachPath : "",//搜索内容
  },
  methods:{
  	handleCommand(command) {
        this.sortName = command.name;//分类显示的名称
        this.sortType = command.type;//分类的类型
        this.sortUrl = command.url;//要跳转到的页面
        this.serachPath = command.path;
    },
    searchBtn(){//搜索按钮
            if(this.sortType==0){
                this.$message({
                    message: '请选择分类',
                    type: 'error',
                    duration : 1000,
                    showClose :　true,
                    customClass : 'sortAlert'
                });
            }else{
                // this.$router.push({name:this.sortUrl, params: {'searchText': this.serachText}});
                if(!this.serachText){
                    window.open(
                      "http://www.jishe.com"+this.serachPath+"?type=0&catid1=0&catid2=0&style=0&id=0&keys=0&sort=0&vip=0&page=0"
                    );
                    // this.$emit('searchClick',0);
                }else{
        window.open(
          `http://www.jishe.com${this.serachPath}?type=${
            this.sortType
          }&catid1=0&catid2=0&style=0&id=0&keys=${
            this.serachText ? this.serachText : 0
          }&sort=0&vip=0&page=0`
        );
                    // this.$emit('searchClick',this.serachText);
                }
                
                
            }
            
        }
  }
});

/* $(function(){
		$(".login").click(function(){
					window.open("http://www.jishe.com/?gojishe=login")
					}
			);
		$(".registerBtn").click(function(){
					window.open("http://www.jishe.com/?gojishe=register")
					}
			);
		
	}
) */
